#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include<QTimer>
#include <QWidget>
#include"map.h"
#include"myplane.h"
#include<QPushButton>
#include<QMouseEvent>
#include<QLabel>
#include<qstring.h>
#include"bullet.h"
#include"enemyplane.h"
#include"boom.h"
#include"start.h"
#include"item.h"

class MainScene : public QWidget
{
    Q_OBJECT

public:
    MainScene(QWidget *parent = 0);
    void initScene();
    QTimer m_Timer;
    //更新坐标
    void updatePosition();
    //绘图
    void paintEvent(QPaintEvent *event);
    //地图
    Map m_map;
    start game;
   HeroPlane m_hero;
   void mouseMoveEvent(QMouseEvent *event);
   void keyPressEvent(QKeyEvent *event);
   //敌机出场
       void enemyToScene();
       //敌机数组
       EnemyPlane m_enemys[ENEMY_NUM];
       //敌机出场间隔记录
       int m_recorder;
       void collisionDetection();
       int score;
       int bullet_recorder;
       void gameover();
       Bomb m_bombs[BOMB_NUM];
       //飞机碰撞检测
       void planeclocollisionDetection();
       //道具出现间隔
       int item_recorder;
       //道具出场
       void Itemtoscence();
       item items[ENEMY_NUM];
       void itemclocollisionDetection();
       bool unlimited;
private slots:
       void playGame();
       void bulletunlimited();
       void intervalfastslot();
       void intervalmidslot();
       void bulletspeedfastslot();
       void heroplaneshieldslowslot();
       void heroplaneshieldshighslot();
       void mountainmapchangeslot();
       void skymapchangeslot();
       void desertmapchangeslot();
       void firemapchangeslot();
signals:
       void gameoversignal();

};



#endif // MAINWINDOW_H
